﻿<Window x:Class="ScwsWpfClient.WindowMain"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:jas="clr-namespace:WPF.JoshSmith.Controls.Validation"
    Title="Maintenance Mode" Height="524" Width="405" Visibility="Visible" MinHeight="524" MinWidth="405" Name="windowMain" Icon="/ScwsWpfClient;component/ScwsWpfClient.ico">
    <Window.Resources>
        <!-- This style allows a validation error message to be 
         displayed in a TextBox's tooltip. -->
        <Style TargetType="{x:Type TextBox}">
            <Setter Property="Margin" Value="0,8" />
            <Style.Triggers>
                <Trigger Property="Validation.HasError" Value="True">
                    <Setter Property="ToolTip"
            Value="{Binding 
                    RelativeSource={RelativeSource Self}, 
                    Path=(Validation.Errors)[0].ErrorContent
                   }"/>
                </Trigger>
            </Style.Triggers>
        </Style>
    </Window.Resources>
    <Grid Name="gridMain">
        <Grid.RowDefinitions>
            <RowDefinition Height="29*" MaxHeight="29" />
            <RowDefinition Height="29*" MaxHeight="29" />
            <RowDefinition Height="29*" MaxHeight="29" />
            <RowDefinition Height="29*" MaxHeight="29"/>
            <RowDefinition Height="29*" MaxHeight="29"/>
            <RowDefinition Height="107*" MaxHeight="107" />
            <RowDefinition Height="29*" MaxHeight="29"/>
            <RowDefinition Height="29*" MaxHeight="29"/>
            <RowDefinition Height="29*" MaxHeight="29"/>
            <RowDefinition Height="119*" MaxHeight="119"/>
            <RowDefinition Height="32*" MaxHeight="32"/>
        </Grid.RowDefinitions>
        <StatusBar Name="SBar" Background="LightGray" HorizontalContentAlignment="Right" Grid.Row="10" Height="28.739" VerticalAlignment="Bottom"></StatusBar>
        <TabControl Margin="12,14,0,2" Name="tabControlMain" Grid.Row="9" HorizontalAlignment="Left" Width="361">
            <TabItem Header="Windows Computer" Name="tabItemWindowsComputer" IsTabStop="False">
                <Grid>
                    <Button Margin="0,0,72,6" Name="buttonStartComputerMm" Height="23.04" VerticalAlignment="Bottom" Click="buttonStartComputerMm_Click" HorizontalAlignment="Right" Width="60" TabIndex="5" IsDefault="False">Start</Button>
                    <Button Height="23.04" HorizontalAlignment="Right" Margin="0,0,6,6" Name="buttonStopComputerMm" VerticalAlignment="Bottom" Width="60" Click="buttonStopComputerMm_Click">Stop</Button>
                    <TextBox Margin="82,12.96,6,35.04" Name="textBoxComputerName" TabIndex="3" 
                             Text="{Binding Path=Computer}" />
                    <Label Margin="6,8,0,35.04" Name="labelComputerName" HorizontalAlignment="Left" Width="70">Computer:</Label>
                    <CheckBox Height="16" Margin="6,0,0,6" Name="checkBox1" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="89" FlowDirection="RightToLeft" HorizontalContentAlignment="Right" Padding="4,0,5,0" TabIndex="4" IsEnabled="False">Cluster</CheckBox>
                    <Button Height="23.04" Margin="0,0,138,6" Name="buttonQueryComputerMm" TabIndex="5" VerticalAlignment="Bottom" Click="buttonQueryComputerMm_Click" HorizontalAlignment="Right" Width="60">Query</Button>
                </Grid>
            </TabItem>
            <TabItem Header="Group" Name="tabItem1" IsTabStop="False">
                <Grid>
                    <TextBox Margin="82,12.96,6,35.04" Name="textBoxGroupName" TabIndex="3"
                             Text="{Binding Path=Group}" />
                    <Label HorizontalAlignment="Left" Margin="6,8,0,35.04" Name="labelGroup" Width="70" Padding="5">Group:</Label>
                    <Button Height="23.04" HorizontalAlignment="Right" IsDefault="False" Margin="0,0,72,6" Name="buttonStartGroupMm" TabIndex="5" VerticalAlignment="Bottom" Width="60" Click="buttonStartGroupMm_Click">Start</Button>
                    <Button Height="23.04" Margin="0,0,6,6" Name="buttonStopGroupMm" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="60" Click="buttonStopGroupMm_Click">Stop</Button>
                    <Button Height="23.04" Margin="151,0,138,6" Name="buttonQueryGroupMm" TabIndex="5" VerticalAlignment="Bottom" Click="buttonQueryGroupMm_Click">Query</Button>
                    <Button FontSize="11" Height="18.763" HorizontalAlignment="Left" Margin="11,0,0,6" Name="buttonSelectGroup" VerticalAlignment="Bottom" Width="97" HorizontalContentAlignment="Left" Click="buttonSelectGroup_Click">
                        <Button.Template>
                            <ControlTemplate TargetType="Button">
                                <TextBlock TextDecorations="None"><ContentPresenter /></TextBlock>
                            </ControlTemplate>
                        </Button.Template>
                        <Button.Style>
                            <Style TargetType="Button">
                                <Style.Triggers>
                                    <Trigger Property="IsMouseOver" Value="True">
                                        <Setter Property="Foreground" Value="Red" />
                                    </Trigger>
                                </Style.Triggers>
                                <Setter Property="Foreground" Value="Blue" />
                            </Style>
                        </Button.Style> Select Group...
                    </Button>
                </Grid>
            </TabItem>
        </TabControl>
        <TextBox Margin="12,0,0,5.763" Name="textBoxRms" Grid.Row="7" HorizontalAlignment="Left" Width="361"
                 Text="{Binding Path=Rms}" 
                 />
        <Label Height="26" Margin="12,6,0,0" Name="labelComment" VerticalAlignment="Top" HorizontalAlignment="Left" Width="69" Grid.Row="4" Grid.RowSpan="2">Comment:</Label>
        <TextBox Margin="12,0,0,0" Name="textBoxComment" TabIndex="0" Grid.Row="5" FontSize="10" MaxLength="1000" TextWrapping="Wrap" AutoWordSelection="True" HorizontalAlignment="Left" Width="361"
                 Text="{Binding Path=Comment}" />
        <ComboBox Margin="12,6,0,0.803" Name="comboBoxReason" Grid.Row="1" HorizontalAlignment="Left" Width="361" Text="{Binding Path=Reason}" />
        <Label Margin="12,3,0,0" Grid.Row="0" Name="labelReason" Visibility="Visible" HorizontalAlignment="Left" Width="55">Reason:</Label>
        <ProgressBar Grid.Row="10" HorizontalAlignment="Right" Margin="0,6,10,3" Name="progressBar1" Width="100" VerticalAlignment="Center" Height="20" IsIndeterminate="True" IsTabStop="False" Visibility="Collapsed" />
        <Label Margin="12,6,0,26.04" Name="labelRms" Grid.Row="6" HorizontalAlignment="Left" Width="108" Grid.RowSpan="2" VerticalAlignment="Top">RMS:</Label>
        <Label Grid.RowSpan="2" HorizontalAlignment="Left" Margin="12,5,0,0" Name="label1" Width="69" Grid.Row="2" Height="26" VerticalAlignment="Top">Minutes:</Label>
        <TextBox Grid.Row="2" HorizontalAlignment="Left" Margin="12,27.643,0,7.924" Name="textBoxMinutes" Width="120" Grid.RowSpan="2" TabIndex="2"
                Text="{Binding Path=Minutes}" 
                jas:RegexValidator.RegexText="^[5-9]$|^\d{2,6}$"
                jas:RegexValidator.ErrorMessage="Invalid number. Enter a positive integer from 5 to 288000." />
        <Grid Grid.Row="3" Margin="138,0,0,0" Name="grid1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="45" />
                <ColumnDefinition Width="45" />
                <ColumnDefinition Width="45" />
                <ColumnDefinition Width="45" />
                <ColumnDefinition Width="206*" />
            </Grid.ColumnDefinitions>
            <Button FontSize="11" Margin="0" Name="button7DayMm" Click="button7DayMm_Click" HorizontalContentAlignment="Left" Padding="1" OverridesDefaultStyle="True">
                <Button.Template>
                    <ControlTemplate TargetType="Button">
                        <TextBlock TextDecorations="None"><ContentPresenter /></TextBlock>
                    </ControlTemplate>
                </Button.Template>
                <Button.Style>
                    <Style TargetType="Button">
                        <Style.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Foreground" Value="Red" />
                            </Trigger>
                        </Style.Triggers>
                        <Setter Property="Foreground" Value="Blue" />
                    </Style>
                </Button.Style> 7 Days
            </Button>
            <Button FontSize="11" Name="button1DayMm" Click="button1DayMm_Click" Grid.Column="1">
                <Button.Template>
                    <ControlTemplate TargetType="Button">
                        <TextBlock TextDecorations="None"><ContentPresenter /></TextBlock>
                    </ControlTemplate>
                </Button.Template>
                <Button.Style>
                    <Style TargetType="Button">
                        <Style.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Foreground" Value="Red" />
                            </Trigger>
                        </Style.Triggers>
                        <Setter Property="Foreground" Value="Blue" />
                    </Style>
                </Button.Style> 1 Day
            </Button>
            <Button FontSize="11" HorizontalAlignment="Left" Margin="0" Name="button12HourMm" Width="45" Click="button12HourMm_Click" Grid.Column="2" Grid.ColumnSpan="2">
                <Button.Template>
                    <ControlTemplate TargetType="Button">
                        <TextBlock TextDecorations="None"><ContentPresenter /></TextBlock>
                    </ControlTemplate>
                </Button.Template>
                <Button.Style>
                    <Style TargetType="Button">
                        <Style.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Foreground" Value="Red" />
                            </Trigger>
                        </Style.Triggers>
                        <Setter Property="Foreground" Value="Blue" />
                    </Style>
                </Button.Style> 12 Hrs
            </Button>
            <Button FontSize="11" HorizontalAlignment="Left" Margin="0" Name="button6HourMm" Width="45" Grid.Column="3" Grid.ColumnSpan="2" Click="button6HourMm_Click">
                <Button.Template>
                    <ControlTemplate TargetType="Button">
                        <TextBlock TextDecorations="None"><ContentPresenter /></TextBlock>
                    </ControlTemplate>
                </Button.Template>
                <Button.Style>
                    <Style TargetType="Button">
                        <Style.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Foreground" Value="Red" />
                            </Trigger>
                        </Style.Triggers>
                        <Setter Property="Foreground" Value="Blue" />
                    </Style>
                </Button.Style> 6 Hrs
            </Button>
            <Button FontSize="11" Margin="0" Name="button1HourMm" Click="button1HourMm_Click" Grid.Column="4">
                <Button.Template>
                    <ControlTemplate TargetType="Button">
                        <TextBlock TextDecorations="None"><ContentPresenter /></TextBlock>
                    </ControlTemplate>
                </Button.Template>
                <Button.Style>
                    <Style TargetType="Button">
                        <Style.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Foreground" Value="Red" />
                            </Trigger>
                        </Style.Triggers>
                        <Setter Property="Foreground" Value="Blue" />
                    </Style>
                </Button.Style> 1 Hour
            </Button>
        </Grid>
        <ListBox Grid.RowSpan="11" Margin="0,0,0,30" Name="listBoxGroups" Visibility="Hidden" MouseDoubleClick="listBoxGroups_MouseDoubleClick" KeyDown="listBoxGroups_KeyDown"  />
    </Grid>
</Window>
